package com.androidproject.activity;

import com.androidproject.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;

public class TwitterActivity extends Activity {
	
	private Intent intentAccueil;
	private Intent intentClassement;
	private Intent intentCalendrier;
	private Intent intentProgrammeTV;
	private Intent intentFacebook;
	private Intent intentTwitter;
	
	private WebView wvTwitter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_twitter);
		
		wvTwitter = (WebView) findViewById(R.id.wvTwitter);
		wvTwitter.loadUrl("twitter.com/WorldBiz");
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		
		menu.add(0, 1, 0, "News").setIcon(R.drawable.logo_journal);
		menu.add(0, 2, 0, "Classement").setIcon(R.drawable.logo_classement);
		menu.add(0, 3, 0, "Programme TV").setIcon(R.drawable.logo_tv);
		menu.add(0, 4, 0, "Calendrier").setIcon(R.drawable.logo_calendrier);
		menu.add(0, 5, 0, "Twitter").setIcon(R.drawable.logo_twitter);
		menu.add(0, 6, 0, "Facebook").setIcon(R.drawable.logo_facebook);
	    
		return true;
	}
	
	public boolean onOptionsItemSelected(MenuItem item) {
		
		switch (item.getItemId()) {
		case 1:
			intentAccueil = new Intent(this, MainActivity.class);
			startActivity(intentAccueil);
			return true;
			
		case 2:
			intentClassement = new Intent(this, ClassementActivity.class);
			startActivity(intentClassement);
			return true;
			
		case 3:
			intentProgrammeTV = new Intent(this, ProgrammeTvActivity.class);
			startActivity(intentProgrammeTV);
			return true;
			
		case 4:
			intentCalendrier = new Intent(this, CalendrierActivity.class);
			startActivity(intentCalendrier);
			return true;
		
		case 5:
			intentFacebook = new Intent(this, FacebookActivity.class);
			startActivity(intentFacebook);
			return true;
			
		case 6:
			intentTwitter = new Intent(this, TwitterActivity.class);
			startActivity(intentTwitter);
			return true;
			
		default:
			return true;
		}
	}

}
